package  
{
	/**
	 * ...
	 * @author ...
	 */
	public class ParedeManager 
	{
		
		public var AR_Walls:Array = new Array();

		
		public function ParedeManager() 
		{
			this.AR_Walls.push(new Parede(4 * 550, 10, 0, 0, "TOP"));
			this.AR_Walls.push(new Parede(4 * 550 + 10, 10, 0, 4 * 300, "BOT"));
			this.AR_Walls.push(new Parede(10, 4 * 300, 0, 0, "LEFT"));
			this.AR_Walls.push(new Parede(10, 4 * 300, 4 * 550, 0, "RIGHT"));
			
			for (var i:int = 0; i < AR_Walls.length; i++)
			{
				Main.instance.MC_tela.addChild(AR_Walls[i]);
			}
		}
		
		public function verifyTop(pY:Number)
		{
			for (var i:int = 0; i < this.AR_Walls.length; i++)
			{
				if (this.AR_Walls[i].tipo == "TOP")
				{
					if (pY - 17 <= this.AR_Walls[i].y)
					{
						return false;
					}
				}
			}
			return true;
		}
		
		public function verifyBot(pY:Number)
		{
			for (var i:int = 0; i < this.AR_Walls.length; i++)
			{
				if (this.AR_Walls[i].tipo == "BOT")
				{
					if (pY + 13 >= this.AR_Walls[i].y)
					{
						return false;
					}
				}
			}
			return true;
		}
		
		public function verifyLeft(pX:Number)
		{
			for (var i:int = 0; i < this.AR_Walls.length; i++)
			{
				if (this.AR_Walls[i].tipo == "LEFT")
				{
					if (pX - 17 <= this.AR_Walls[i].x)
					{
						return false;
					}
				}
			}
			return true;
		}
		
		public function verifyRight(pX:Number)
		{
			for (var i:int = 0; i < this.AR_Walls.length; i++)
			{
				if (this.AR_Walls[i].tipo == "RIGHT")
				{
					if (pX + 13 >= this.AR_Walls[i].x)
					{
						return false;
					}
				}
			}
			return true;
		}
	}

}